<div class="hts-doc-text">

  Tvheadend support connecting to card clients via the cwc (newcamd) or capmt
  (dvbapi) protocol for so called softcam descrambling.

 <p>
 <img src="docresources/configcwc.png">

 <p>
 The servers are listed / edited  in a grid. 

 <ul>
  <li>To edit a cell, double click on it. After a cell is changed it
      will flags one of its corner to red to indicated that it has been
      changed. To commit these changes back to Tvheadend press the 
      'Save changes' button. In order to change a Checkbox cell you only
      have to click once in it.

  <li>To add a new entry, press the 'Add entry' button. The new (empty) entry
      will be created on the server but will not be in its enabled state.
      You can now change all the cells to the desired values, check the
      'enable' box and then press 'Save changes' to activate the new entry.

  <li>To delete one or more entries, select the lines (by clicking once on 
      them), and press the 'Delete selected' button. A pop up
      will ask you to confirm your request.
 </ul>

 <p>
 The columns have the following functions:

 <dl>
  <dt>Enabled
  <dd>If selected, connection will be tried to be established and retained up.
      If unselected, Tvheadend will disconnect (if connected) and not try to reconnect.

  <dt>Hostname
  <dd>Server hostname. DNS lookup is performed upon every connection attempt.

  <dt>Port
  <dd>Server TCP port

  <dt>Username
  <dd>Username to use.

  <dt>Password
  <dd>Password to use.

  <dt>DES Key
  <dd>Initial DES key.

  <dt>Update Card
  <dd>Forward Entitlement Management Messages (EMMs) to the server.

  <dt>Update One
  <dd>Forward EMMs only from one channel at a time.

  <dt>Comment
  <dd>Allows the administrator to set a comment only visible in this editor.
      It does not serve any active purpose.
 </dl>

 <p>
 <img src="docresources/configcapmt.png">

 <p>
 The servers are listed / edited  in a grid. 

 <ul>
  <li>To edit a cell, double click on it. After a cell is changed it
      will flags one of its corner to red to indicated that it has been
      changed. To commit these changes back to Tvheadend press the 
      'Save changes' button. In order to change a Checkbox cell you only
      have to click once in it.

  <li>To add a new entry, press the 'Add entry' button. The new (empty) entry
      will be created on the server but will not be in its enabled state.
      You can now change all the cells to the desired values, check the
      'enable' box and then press 'Save changes' to activate the new entry.

  <li>To delete one or more entries, select the lines (by clicking once on 
      them), and press the 'Delete selected' button. A pop up
      will ask you to confirm your request.
 </ul>

 <p>
 The columns have the following functions:

 <dl>
  <dt>Enabled
  <dd>If selected, connection will be tried to be established and retained up.
      If unselected, Tvheadend will disconnect (if connected) and not try to reconnect.

  <dt>Camd.socket Filename / IP Address
  <dd>Socket filename which is usually opened by cam client. Tvheadend
      tries to connect to this socket file.
      <br><br>
      In mode 3 (TCP), enter the IP address of the oscam server. Tvheadend
      tries to create a TCP connecting to this IP adress and <i>Connect port</i>.

  <dt>Listen / Connect port
  <dd>If running on a so called full-featured DVB-Card this can be left
      empty.
      Running on Budget-Cards one has to use a dummy ca-device. This is
      emulated via capmt_ca.so. This module has to be pre-loaded prior to
      the cam client.
      <dl>
        <dt>LD_PRELOAD=/path/to/capmt_ca.so cam_client &
      </dl>
      This module will communicate the received control-words back to
      Tvheadend via Port 9000
      <br><br>
      In mode 3 (TCP), this port is used for the oscam connection. It must
      be equal to the listen port in the oscam/dvbapi settings.

  <dt>OSCam mode
  <dd>
  
      <dt>mode 0 (LD_PRELOAD)
      <dd>LD_PRELOAD hack is active
      
      <dt>mode 1 (old OSCam)
      <dd>If selected, connection will be made directly to oscam without
          using LD_PRELOAD hack.<br>
          Port 9000 will be used automatically.<br><br>
          The following lines are required in <b>[dvbapi]</b> section of oscam.conf file:
          <dl>
            <dt>boxtype = pc<br>
                pmt_mode = 4
          </dl>
          
      <dt>mode 2 (new OSCam since revision 9095)
      <dd>In this mode, no UDP connections are required. All communication
          is processed though the Camd.socket. The configuration for OSCam
          should be same as for mode 1.
          
      <dt>mode 3 (new OSCam since revision 9574)
      <dd>A TCP connection to server is created. All emm/ecm data are send
          to oscam using this connection without a requirement for the real
          linuxdvb devices in the system with OSCam. This mode is suitable
          for all DVB devices including SAT>IP and IPTV.<br><br>
          The following lines are required in <b>[dvbapi]</b> section of oscam.conf file:
          <dl>
            <dt>boxtype = pc<br>
                pmt_mode = 4<br>
                listen_port = 9000 # or your preferred port<br>
          </dl>

      <dt>mode 4 (new OSCam since revision 9754)
      <dd>Similar to mode 3, but a Camd.socket connection is used instead
          of the TCP connection.<br><br>
          The following lines are required in <b>[dvbapi]</b> section of oscam.conf file:
          <dl>
            <dt>boxtype = pc-nodmx<br>
                pmt_mode = 4
          </dl>

      <dt>mode 5 (new OSCam since revision 10087)
      <dd>Similar to mode 3 (TCP), but uses a new network protocol which also added
          client/server greeting messages and protocol version information (to be able
          to smoothly detect enhancements in the future).<br><br>
          <b>This is currently the preferred mode (the other may be removed in future)!</b><br><br>
          The following lines are required in <b>[dvbapi]</b> section of oscam.conf file:
          <dl>
            <dt>boxtype = pc<br>
                pmt_mode = 4<br>
                listen_port = 9000 # or your preferred port<br>
          </dl>

  <dt>Comment
  <dd>Allows the administrator to set a comment only visible in this editor.
      It does not serve any active purpose.
 </dl>
</div>
